﻿using System.Collections.Generic;
using BoutiquePOS.DAL.DAO;
using BoutiquePOS.DAL.Gateway;

namespace BoutiquePOS.Manager
{
    public class PurchaseManager
    {
        private PurchaseGateway aPurchaseGateway = new PurchaseGateway();
        
        public void SavePurchaseDtls(List<PurchaseDtls> purchaseDtls)
        {
            aPurchaseGateway.SavePurchaseDtls(purchaseDtls);
        }
        public void SavePurchase(Purchase aPurchase)
        {
            aPurchaseGateway.SavePurchase(aPurchase);
        }

        public PurchaseDtls FindPurchaseById(int purchaseId)
        {
            return aPurchaseGateway.FindPurchaseById(purchaseId);
        }
        public List<PurchaseDtls> GetAllPurchaseDtls()
        {
            return aPurchaseGateway.GetAllPurchaseDtls();
        }
        public string GetPurchaseAutoCompleteData(int formId)
        {
            return aPurchaseGateway.GetPurchaseAutoCompleteData(formId);
        }
        public string NextID(string yearAndMonth)
        {
            return aPurchaseGateway.NextID(yearAndMonth);
        }
        public Supplier GetSupplierId(string supplierName)  
        {
             SupplierGateway supplierGateway=new SupplierGateway();
            return supplierGateway.FindSupplier(supplierName);
        }    
    }
}